<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
//pageContext.request.contextPath
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>迅扬供热管理系统</title>
<style type="text/css">
body {
	margin:0 auto;
	padding:0;
	font-size:14px;
	color:#fff;
	background:#eee;
}
form {
	margin:0;
	padding:0;
}
input {
	vertical-align:middle;
}
table, td {
	font-size:14px;
}
#logbox {
	margin:-210px 0 0 -350px;
	width:700px;
	height:415px;
	border:solid 5px #fff;
	position:absolute;
	top:50%;
	left:50%;
}
#logbg {
	padding:0 0 0 15px;
	background:url(${request.contextPath}/images/mge/log04.jpg) no-repeat 0 0;
}
.logipt {
	height:20px;
	line-height:20px;
	font-family:Arial, Helvetica, sans-serif;
	border:solid 1px #090;
}
#validate img {
	margin:0 0 0 10px;
	display:inline;
}
</style>
<script type="text/javascript">
function check(){
	if(document.form1.username.value==""){
		alert("用户名为空！");
		document.form1.username.focus();
		return false;
	}
	if(document.form1.password.value==""){
		alert("密码为空！");
		document.form1.password.focus();
		return false;
	}
	if(document.form1.validity.value==""){
		alert("验证码为空！");
		document.form1.validity.focus();
		return false;
	}
	pwCheck(document.form1.password.value);
	return true;
}
 function pwCheck(str){
	  var number_str ,big_a,small_a,sign,count=0;
		  number_str=/\d/;
		  big_a=/[A-Z]/;
		  small_a=/[a-z_]/;  //小写字母 加上'_' （下划线 ）
		  sign=/\W/;
	  if (str.match(number_str)!=null)count++;
	  if (str.match(big_a)!=null)count++;
	  if (str.match(small_a)!=null)count++;
	  if (str.match(sign)!=null)count++;
	  //密码位数小于6，定为弱
	  if (str.length<6)  {
	  	count=1;
	  }
	  if(count==1)  {
		alert("您的密码安全性等级过弱.\n请登录后重新修改密码,\n(建议使用大小写数字特殊字符混用密码)");
	  }
}
function show()
{
	validity_img = document.getElementById("validity_img");
	validity_img.style.display="";
	validity_img.src="${pageContext.request.contextPath}/images/validity.jpg?r="+Math.random();
}
function hide()
{
	validity_img = document.getElementById("validity_img");
	validity_img.style.display="none";
	validity_img.src="aa.jpg";
}
window.onload = function()
{
	show();
//	document.forms[0].validity.onfocus=show;
//	document.forms[0].validity.onblur=hide;
}
</script>
</head>
<body>
<table id="logbox" width="700" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="3"><img src="${request.contextPath}/images/mge/log01.jpg" alt="" /></td>
  </tr>
  <tr>
    <td colspan="3"><img src="${request.contextPath}/images/mge/log02.jpg" alt="" /></td>
  </tr>
  <tr>
    <td width="305"><img src="${request.contextPath}/images/mge/log03.jpg" alt="" /></td>
    <td width="345" id="logbg">
    <form id="form1" name="form1" method="post" action="${pageContext.request.contextPath}/login.action" onsubmit="return check();">
    <input type="hidden" name="type" value="2" />
        <table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td width="70%">用&nbsp;户&nbsp;名：
              <input name="username" type="text" class="logipt" size="18" tabindex="1" /></td>
            <td width="30%" rowspan="2"><input type="image"	name="imageField22" src="${request.contextPath}/images/login.gif" /></td>
          </tr>
          <tr>
            <td>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：
            <input name="password" type="password" class="logipt" size="18" tabindex="2" /></td>
          </tr>
          <tr>
            <td colspan="2" id="validate">验&nbsp;证&nbsp;码：
              <input name="validity" type="text" class="logipt" size="10" maxlength="4" tabindex="3" />
              <img id="validity_img" style="display:none" src="${pageContext.request.contextPath}/images/validity.jpg" width="60" height="20" align="absmiddle" alt="验证码" /></td>
          </tr>
        </table>
      </form></td>
    <td width="50"><img src="${request.contextPath}/images/mge/log05.jpg" alt="" /></td>
  </tr>
  <tr>
    <td colspan="3"><img src="${request.contextPath}/images/mge/log06.jpg" alt="" /></td>
  </tr>
</table>
</body>
</html>